<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" href="/resources/static/css/base.css" />
        <link rel="stylesheet" href="/resources/static/css/skeleton.css" />
        <link rel="stylesheet" href="/resources/static/css/layout.css" />
    </head>
    <body>
        <div class="container">
            <div class="sixteen columns">
                <h1>RSS Agregator</h1>
            </div>
            <div class="sixteen columns">
                <c:forEach items="${chanels}" var="ch">
                    <div class="chanel">
                        <h3><c:out value="${ch.title}" /></h3>
                        <div class="items">
                            <c:forEach items="${ch.items}" var="it">
                                <div class="row">
                                    <div class="one columns alpha">
                                        &nbsp;
                                    </div>
                                    <div class="fifteen columns omega">
                                        <a href="${it.link}"><c:out value="${it.title}" /></a>
                                    </div>
                                </div>
                            </c:forEach>
                        </div>
                    </div>
                </c:forEach>
            </div>
            <sf:form method="POST" modelAttribute="chanel">
                <div class="sixteen columns">
                    <div class="warning">
                        <sf:errors path="*" cssClass="warning" />
                    </div>
                </div>
                <div class="sixteen columns">
                    <div class="four columns alpha">
                        <label for="chanel_link">Chanel Link:</label>
                        <sf:input path="link" size="1000" id="chanel_link" />
                    </div>
                    <div class="four columns">
                        <label for="chanel_id">Chanel ID:</label>
                        <sf:input path="id" id="chanel_id" />
                    </div>
                    <div class="four columns">
                        <label for="chanel_title">Chanel Title:</label>
                        <sf:input path="title" id="chanel_title" />
                    </div>
                    <div class="four columns omega">
                        <label>&nbsp;</label>
                        <input type="submit" value="Add chanel" />
                    </div>

                </div>
            </sf:form>
        </div>
    </body>
</html>
